Skip to content

Fix for #738#841

Merged
whilo merged 4 commits into
replikativ:mainfrom
harismh:harismh/738-fix-swagger-server-error
Jun 21, 2026
Merged

Fix for #738#841
whilo merged 4 commits into
replikativ:mainfrom
harismh:harismh/738-fix-swagger-server-error

Conversation

@harismh

@harismh harismh commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

SUMMARY

Fixes #738. Root cause was not swagger code itself, but local GET requests to swagger not having Content-Type set. encode-plain-value then calls a nil function, causing the crash. Fix was to make the encoder a noop if nil. Added basic tests to better catch swagger issues in the future.

Note: Had to run codegen-java before running bb http-server-uber on a first clone. I added jcompile as build dependency to http-server-jcompile to workaround that.

Checks

Bugfix
  • Related issues linked using fixes #number
Feature
  • Related issues linked using fixes #number

ADDITIONAL INFORMATION

New tests pass. Original reproduction is fixed too.

  1. bb http-server-uber
  2. java -jar target-http-server/datahike-http-server-XXX.jar resources/example_server.edn
  3. browse http://localhost:4444/index.html

harismh added 3 commits June 20, 2026 17:42
GET requests like for Swagger do not
have content-type set, causing #(encoder %)
to eventually call a nil function. Encoder
is now a noop if formatter is nil.
@harismh harismh changed the title Harismh/738 fix swagger server error Fix for #738 Jun 20, 2026
@whilo whilo merged commit 9401131 into replikativ:main Jun 21, 2026
@whilo

whilo commented Jun 21, 2026

Copy link
Copy Markdown
Member

@harismh Thank you! I would be curious what you are using/experimenting with, couldn't find you on the Clojurians slack though.

@harismh

harismh commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

@whilo Thanks for the review and merge. Just added my GitHub handle to Clojurians, so that should make it easier to find me (lots of Haris's now haha.).

I mainly work in internal enterprise systems, lately data brokerage and decision systems that have to interact with many different schemas. So, Datalog has always been on my radar. Enterprises tend to be pretty weary of new tech, so I did ultimately go with more traditional approaches. Believe Datahike's SQL adapter wasn't available back then either.

But, my projects are winding down so I have spare time to help contribute back. I'll take a look at the other issues too.

@harismh harismh deleted the harismh/738-fix-swagger-server-error branch June 21, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: datahike.http.server fails to load swagger.json

2 participants